package com.example.mqconsumer.consumer;

import com.example.common.message.Demo05Message;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Log4j2
//@Component
@RabbitListener(queues = Demo05Message.QUEUE)
public class Demo05Consumer {

    @RabbitHandler
    public void onMessage(Demo05Message message) {
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }

}